#include<iostream>
#include<algorithm>
using namespace std;
#include<assert.h>
#include"list.h"
//int main()
//{
//	//lj::testlist1();
//	lj::testlist2();
//	return 0;
//}
struct Pos
{
	int _row;
	int _col;
	Pos(int row = 0, int col = 0)
		:_row(row)
		, _col(col)
	{}
};
void print_list(const lj::list<Pos>& lt)
{
	lj::list<Pos>::const_iterator it = lt.begin();
	while (it != lt.end())
	{
		//it->_row++;

		cout << it->_row << ":" << it->_col << endl;

		++it;
	}
	cout << endl;
}
void test_list()
{
	lj::list<Pos> lt;
	Pos p1(1, 1);
	lt.push_back(p1);
	lt.push_back(p1);
	lt.push_back(p1);
	lt.push_back(Pos(2, 2));
	lt.push_back(Pos(3, 3));

	// int* p  -> *p
	// Pos* p  -> p->
	lj::list<Pos>::iterator it = lt.begin();
	//list<Pos>::iterator it2 = it;
	while (it != lt.end())
	{
		it->_row++;

		//cout << (&(*it))->_row << ":" << (*it)._col << endl;
		cout << it->_row << ":" << it->_col << endl;
		//cout << it.operator->()->_row << ":" << it->_col << endl;

		++it;
	}
	cout << endl;
	print_list(lt);
}
int main()
{
	test_list();
	return 0;
}